<?php echo $this->render($this->includeDir . '/toolbar.php');?>
<?php echo $this->flashMessage();?>
<?php 
	/*===============================================
	 * Start - Tạo các phần tử cho Form
	 *===============================================*/	
	$code 		= $this->formText('code',$this->Item['code'],array('class'=>'width-200 bg-green2 floatLeft'));	
	$name 		= $this->formText('name',$this->Item['name'],array('class'=>'width-300 bg-green2 floatLeft' ));
	//$name 		.= $this->cmsError('name');
	
	$options 	= array('admin'=>' Admin ','public'=>' Public ');	
	$area 		= $this->formSelect('area',$this->Item['area'],array('class'=>'width-150'),$options);
	
	$options 	= array('inactive'=>$this->translate('Inactive'),'active'=>$this->translate('Active'));	
	$status 	= $this->formSelect('status',$this->Item['status'],array('class'=>'width-150'),$options);
	
	$ordering 	= $this->formText('ordering',$this->Item['ordering'],array('class'=>'width-100 floatLeft'));
	
	/*=======================================================
	 * Start - Tạo Tooltip cho các phần từ input trong form
	 *=======================================================*/	
	$formHelp = '';
	$formHelp  .= $this->cmsFormHelp('.form-table #name', $this->translate("Name of language ( Ex: Vietnam, English...)"));
	$formHelp  .= $this->cmsFormHelp('.form-table #code', $this->translate("Code of language ( Ex: vi, en, de ...)"));
	$formHelp  .= $this->cmsFormHelp('.form-table #area', $this->translate("Language of area on website"));
	$formHelp  .= $this->cmsFormHelp('.form-table #status', $this->translate("Status of language"));
	$formHelp  .= $this->cmsFormHelp('.form-table #ordering', $this->translate("Ordering of language ( Ex:1, 5, 10 ...)"));	
	
	/*=======================================================
	 * Start - Hiển thị các thông báo error của Form 
	 *=======================================================*/			
	 if(count($this->errors)>0){	
	 	foreach ($this->errors as $key => $val){	 		
	 		$$key .= $this->cmsError($key,$val);	
	 		$selector = '.form-table #' . $key . '-error';
	 		$options = array('type'=>'error','name'=>'#' .$key);
	 		$formHelp  .= $this->cmsFormHelp($selector, $this->translate($val),null,$options);
	 		
	 	}
	 }
?>

<script type="text/javascript">
	$(document).ready(function() {
		<?php echo $formHelp;?>
	});
</script>
<div id="element-box">
	<div class="m">
		<div class="form-table">
            	<fieldset class="admin-fieldset">
                <legend class="admin-legend"><?php echo $this->translate('Form Detail')?></legend>
            	<table width="100%" border="0">
                	<tr>
                    	<td class="label"><?php echo $this->translate('Name')?>:</td>
                        <td class="element"><?php echo $name;?></td>
                    </tr>
                    <tr>
                    	<td class="label"><?php echo $this->translate('Code')?>:</td>
                        <td class="element"><?php echo $code;?></td>
                    </tr>
                    <tr>
                    	<td class="label"><?php echo $this->translate('Area')?>:</td>
                        <td class="element"><?php echo $area;?></td>
                    </tr>
                    <tr>
                    	<td class="label"><?php echo $this->translate('Status')?>:</td>
                        <td class="element"><?php echo $status;?></td>
                    </tr>
                    <tr>
                    	<td class="label"><?php echo $this->translate('Ordering')?>:</td>
                        <td class="element"><?php echo $ordering;?></td>
                    </tr>
                </table>
                <div class="clr"></div>
                </fieldset>             
            </div>
            <div class="clr"></div>
	</div>
</div>
